#!/bin/bash

srcdir="./"

animals="animal1 animal2 animal3"

let cnt=1
for i in $animals; do 
    wrkdir=$(find -name $i)
    echo $wrkdir
    infile=$(find ./ -name '*.fasta' | grep $wrkdir/)
    echo $infile
    nohup $srcdir/vgenextractor.py $infile $wrkdir/outV.dat > $wrkdir/nohup.results &

    let cnt+=1    
    a=$(( $cnt % 3 ))
    echo $cnt, $a
    if [ $a -eq 0 ]; then 
           echo "...."; 
	   let cnt=0
    fi
    sleep 1s

done

